# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=golang-github-jung-kurt-gofpdf
pkgver=2.5.0
pkgrel=1
pkgdesc='A PDF document generator with high level support for text, drawing and images'
arch=('any')
url="https://github.com/jung-kurt/gofpdf"
license=('MIT')
depends=('go')
source=("$pkgname-$pkgver.tar.gz::https://github.com/jung-kurt/gofpdf/archive/v$pkgver.tar.gz")
sha512sums=('d417bbb38f041d6ce6c45c790c888437a883691e4acd3f8d8806ba63e4c5146edf69d591a81c8f567beba3a4803dbc6fd77baf4bf943266b24bfa0a1cb547a2f')

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  mkdir -p "$srcdir"/build/src/github.com/jung-kurt
  cp -a "$srcdir"/gofpdf-$pkgver "$srcdir"/build/src/github.com/jung-kurt/gofpdf
  cd "$srcdir"/build/src/github.com/jung-kurt/gofpdf
  go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/jung-kurt
  cp -a "$srcdir"/gofpdf-$pkgver "$pkgdir"/usr/share/gocode/src/github.com/jung-kurt/gofpdf

  install -Dm644 gofpdf-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
